<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=exceldata.xls");
header("Pragma: no-cache");
header("Expires: 0");
?> 
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record">
                <tr align="center">
                    <td colspan="7" height="25">Laporan Keuangan</td>
                </tr>
                <tr align="center">
                    <td>No Kwitansi</td>
                    <td>No Faktur</td>
                    <td>Kode Bank/Giro</td>
                    <td>Nama Bank</td>
                    <td>Quantity</td>
                    <td>Debet</td>
                    <td>Kredit</td>
                </tr>
                <?php 
					$totalin = 0;
					$totalout = 0;
					foreach($data as $items) 
					{
						$totalout = $totalout + $items->TotalAmount_Out;
						$totalin = $totalin + $items->TotalAmount_In;
				?> 
                <tr class="cellDefault">
                    <td><?php echo $items->NoKwitansi;?></td>
                    <td><?php echo $items->NoFaktur;?></td>
                    <td><?php echo $items->KodeBank;?></td>
                    <td><?php echo $items->Bankname;?></td>
                    <td><?php echo $items->TotalQuantity;?></td>
                    <td><?php echo $items->TotalAmount_Out;?></td>
                    <td><?php echo $items->TotalAmount_In;?></td>
                </tr>
                <?php } ?>
                <tr>
                	<td colspan="5" align="center"><strong>Total</strong></td>
                    <td><strong><?=$totalout?></strong></td>
                    <td><strong><?=$totalin?></strong></td>
                </tr>
            </table> 